package com.zgm.ch05.aop._3_2;

import org.springframework.aop.framework.ProxyFactory;

public class HelloWorldWeaver {
	
	public static void main(String[] args){
		MessageWriter target = new MessageWriter();
		ProxyFactory pf = new ProxyFactory();
		
		/*pf.addAdvice(new MessageDecorator());
		pf.setTarget(target);*/
		
		pf.setTarget(target);
		pf.addAdvice(new MessageDecorator());
		
		
		MessageWriter proxy = (MessageWriter) pf.getProxy();
		
		target.writeMessage();
		System.out.println("");
		proxy.writeMessage();
	}

}
